//导航栏吸顶
window.addEventListener('scroll',() =>{
    let header = document.querySelector('header')
    header.classList.toggle('sticky',window.scrollY > 0)
});

window.addEventListener('scroll',() => {
    // let lest = document.querySelector('.list-1')
    let list = document.getElementsByClassName('list-1');
    for (var length=0;length < list.length;length++){
        let lest = document.getElementsByClassName('list-1')[length];
        lest.classList.toggle('newlist',window.scrollY > 60)
    }
});

$('.nav-link1').click(function() {
    var navto = $(this).attr('navto');
    console.log(navto)
    if(navto != "#") {
        var $div = $('#' + navto);
        console.log($div)
        var top = $div.offset().top;
        $('html,body').animate({
            'scroll-top': top - 70
        }, 500);
    }
});


